#ifndef _CONTROL_CONFIG_H_
#define _CONTROL_CONFIG_H_

#include "xml.h"
#include "mysqlmgr.h"

void parse_moudle_path();

void create_dir(const char* input);

void get_arg_params(int argc, char** argv);

int write_console(const char* inbuf, int inlen = 0);

string replace_separator(const char* inbuf, const char srcdelim, const char destdelim);

class CConfig : public CXmlBlock
{
    friend class CCowWork;

    CConfig();

public:

    ~CConfig();

    string GetWorkType();

    int  GetWorkThreadCount();

    string GetWorkIp(int index = 1);

    ushort GetWorkPort(int index = 1);
    
    bool GetSqlInfo(SqlInfo& sqlinfo);

    bool ParseConfig(const char* input, ushort inlen);

protected:


private:

    string  m_buffer;

    CByteBlock* m_block;
};

#endif //_CONTROL_CONFIG_H_
